<template>
  <div id="myChart" :style="{width: '400px', height: '300px'}"></div>
</template>
<script>
export default {
  name: 'pie',
  mounted(){
    // 基于准备好的dom，初始化echarts实例
    let myChart = this.$echarts.init(document.getElementById('myChart'))
    // 绘制图表
    myChart.setOption({
      title: {
        text: '3D打印类型统计',
        subtext: 'Fake Data',
        left: 'center'
      },
      tooltip: {
        trigger: 'item'
      },
      legend: {
        orient: 'vertical',
        left: 'left'
      },
      series: [
        {
          // name: 'Access From',
          type: 'pie',
          radius: '50%',
          data: [
            //value:该类型的数值、itemStyle：样式设置color为颜色设置、name：类型名称
            { value: 1048, itemStyle: {color: "#3fb1e3"}, name: '金属打印' },
            { value: 735, itemStyle: {color: "#c4ebad"},name: '非金属打印' },
            { value: 580, itemStyle: {color: "#6be6c1"},name: '激光熔覆' },
            // { value: 484, name: 'Union Ads' },
            // { value: 300, name: 'Video Ads' }
          ],
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
          }
        }
      ]
    });
  }
}
</script>
